package com.ruoyi.zhgd.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.zhgd.service.IZjHomeService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * 报警通知短信发送是否启用信息
 *
 * @author tll
 * @date 2023-11-16
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/zhgd/home")
public class ZJHomeController extends BaseController {

    private final IZjHomeService iZjHomeService;

    /**
     * 首页-接入设备及预警统计
     */
    @SaCheckLogin
    @GetMapping("/count")
    public R<List<Map<String, Object>>> count(@RequestParam Map<String, Object> params) {
        return iZjHomeService.count(params);
    }

    /**
     * 首页-拌合站今日生产统计(水稳沥青混凝土)
     */
    @SaCheckLogin
    @GetMapping("/productToday")
    public R<List<Map<String, Object>>> productToday(@RequestParam Map<String, Object> params) {
        return iZjHomeService.productToday(params);
    }

    /**
     * 首页-拌合站产能统计(一二三四标)
     */
    @SaCheckLogin
    @GetMapping("/productYear")
    public R<List<List<Object>>> productYear(@RequestParam Map<String, Object> params) {
        return iZjHomeService.productYear(params);
    }

    /**
     * 首页-各标段实验次数与不合格次数对比分析
     */
    @SaCheckLogin
    @GetMapping("/labEligibleCount")
    public R<List<List<Object>>> labEligibleCount(@RequestParam Map<String, Object> params) {
        return iZjHomeService.labEligibleCount(params);
    }

    /**
    * 首页-各标段实验次数与不合格次数对比分析
    * @author cj
    * @date 2023/11/28 8:50
    * @return
    **/
    @GetMapping("/selectLabEligibleCount")
    public R<List<List<Object>>> selectLabEligibleCount(@RequestParam Map<String, Object> params) {
        return iZjHomeService.selectLabEligibleCount(params);
    }

    /**
     * 首页-各标段张拉梁片次数对比
     *
     * @param params
     * @return
     */
    @SaCheckLogin
    @GetMapping("/tensionBeamNoCount")
    public R<List<Map<String, Object>>> tensionBeamNoCount(@RequestParam Map<String, Object> params) {
        return iZjHomeService.tensionBeamNoCount(params);
    }

    /**
     * 首页-各标段实验室设备在线统计
     *
     * @param params
     * @return
     */
    @SaCheckLogin
    @GetMapping("/labDeviceOnlineCount")
    public R<List<Map<String, Object>>> labDeviceOnlineCount(@RequestParam Map<String, Object> params) {
        return iZjHomeService.labDeviceOnlineCount(params);
    }

    /**
     * 首页-各标段拌合站设备在线统计
     *
     * @param params
     * @return
     */
    @SaCheckLogin
    @GetMapping("/mixDeviceOnlineCount")
    public R<List<Map<String, Object>>> mixDeviceOnlineCount(@RequestParam Map<String, Object> params) {
        return iZjHomeService.mixDeviceOnlineCount(params);
    }

    /**
     * 首页-接入设备及预警统计-最新
     * @param params
     * @return
     */
    @SaCheckLogin
    @GetMapping("/newCount")
    public R<List<Map<String, Object>>> newCount(@RequestParam Map<String, Object> params) {
        return iZjHomeService.newCount(params);
    }

    /**
     * 预警待办消息通知数量统计
     * @return
     */
    @SaCheckLogin
    @GetMapping("/todoCount")
    public R<List<Map<String, Object>>> todoCount() {
        return iZjHomeService.todoCount();
    }

}
